-
Notifications
You must be signed in to change notification settings - Fork 277
Java frontend: record source locations of read static variables #5144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java frontend: record source locations of read static variables #5144
Conversation
35e1803
to
e97ed5c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
Passed Diffblue compatibility checks (cbmc commit: e97ed5c).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/130069395
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
symbol_expr->source_location().get_java_bytecode_index() == "0" && | ||
symbol_expr->get_identifier() == | ||
"java::ClassReadingStaticField.x") | ||
found = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛏️ multi line condition so please add braces around the body
|
||
WHEN("Converting the method that reads said field") | ||
{ | ||
const auto &method_symbol = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛏️ if the symbol isn't found, using lookup_ref makes the output on CI not very clear, better to use lookup and then REQUIRE(method_symbol != nullptr)
This enables trace-source-location reports not to vary depending on whether static initializer calls were produced or not (at present the call would result in a statement at the getstatic location, while the variable read itself would disappear; a 'putstatic' instruction by contrast always generates an assignment and so is accounted for by a source location).
e97ed5c
to
4c5ddc9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
Passed Diffblue compatibility checks (cbmc commit: 4c5ddc9).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/130528948
Codecov Report
@@ Coverage Diff @@
## develop #5144 +/- ##
========================================
Coverage 67.07% 67.07%
========================================
Files 1149 1149
Lines 94030 94030
========================================
Hits 63075 63075
Misses 30955 30955
Continue to review full report at Codecov.
|
This enables trace-source-location reports not to vary depending on whether static initializer
calls were produced or not (at present the call would result in a statement at the getstatic
location, while the variable read itself would disappear; a 'putstatic' instruction by contrast
always generates an assignment and so is accounted for by a source location).